Repository navigation
feat(output)!: print a default field set on -j listings, with --fields all for the full record - #454
Merged
Merged
Conversation
…s all for the full record Without --fields, a JSON task listing, search and projects now print the keys an agent needs to pick an item and act on it. Notes, the parent uuids, creationDate and Things' bookkeeping need --fields all or show. An empty --fields gets the unknown field payload with the valid names. BREAKING CHANGE: -j on listings no longer prints every key; pass --fields all for the previous output.
ryanlewis
force-pushed
the
feat/json-default-fields
branch
from
October 10, 2026 14:29
8e18ecf to
fe7344d
Compare
…hows This Evening
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behaviour change
-jon a task listing (every view, filteredlist),searchandprojectsno longer prints every key. Without--fieldsit prints a default set per kind;--fields allprints the full record, byte-identical to the old-joutput. A script that readsnotes,projectUUID,areaUUID,headingUUID,creationDate,index,todayIndexortrashedoff a task listing, orstartBucketoff aprojectsrow, needs--fields all(orthings show <uuid> -j).show -jis unchanged.Default sets
Defined next to
TaskFields/ProjectFieldsininternal/output/fields.go, in record order.uuid,title,type,status,start,startBucket,startDate,reminderTime,deadline,stopDate,projectTitle,projectTrashed,areaTitle,headingTitle,tags,repeating,checklistProgressuuid,title,status,start,startDate,deadline,areaTitle,tags,taskCount,openCountLeft out of tasks:
notes: the bulk of the output (about half of a full listing); an agent reads them for the one item it acts on, withshow.projectUUID,areaUUID,headingUUID: an agent acts on the item's ownuuid; it filters by project or area with--project/--area, which take titles.creationDate: rarely used to choose an item; available with--fields.index,todayIndex: Things' internal sort keys; the listing is already in the app's order.trashed: always false outside thetrashview, always true inside it.startBucketstays in: it is howtoday -jtells the app's This Evening rows apart, and matching what Things.app shows is the project's goal.projectTrashedstays in: it is omitempty, so it costs nothing on ordinary rows, and on--project <trashed project>it tells an agent the row will be refused before it tries a write.Left out of projects:
startBucket(a project's This Evening placement only matters inside atodaylisting, which carries it) andareaUUID(as above).taskCountstays in, because the docs' own "projects with nothing left open" recipe uses it.all--fields allon its own prints the full record.allwith other names (all,notes) is refused with a plain error, sinceallalready names them. No JSON key is namedall, and a test keeps it that way.Small fixes
--fields(""," , ") now gets theunknown fieldpayload withvalidand nounknown, instead of the genericerrortoken.docs/content/commands.mdhard-codes the key lists, so a new test (internal/output/docs_test.go) ties them, and the default sets in commands.md and SKILL.md, to the variables.Sizes
On a copy of today's Things backup DB, old
-jvs new-j(bytes):anytime -a "Personal Projects"(94 tasks)todayupcomingdeadlinessearch thelogbookprojects--fields allmatched the old-jbyte for byte on every listing above (also inbox, someday, trash, repeating,projects --completed,list --project). Wall time forlogbook -jis unchanged (~25 ms).Docs
SKILL.md,
docs/content/commands.md,docs/content/agents.mdand the README output paragraph are updated.docs/content/changelog.mdis generated from release notes, so it is not edited.